//
//  ChannelModel.m
//  WY
//
//  Created by lanou3g on 16/5/9.
//  Copyright © 2016年 pcc. All rights reserved.
//

#import "ChannelModel.h"
#import <YYModel.h>
@implementation ChannelModel

+ (NSArray *)channelArrData {
    //文件路径;
    NSString *path = [[NSBundle mainBundle]pathForResource:@"topic_news" ofType:@"json"];
    NSLog(@"%@",path);
    //取出数据
    NSData *data = [NSData dataWithContentsOfFile:path];
    //解析json数据
    NSDictionary *result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    //取出第一个key
    NSString *key = result.keyEnumerator.nextObject;
    //取出json数据
    NSArray *array = result[key];
    //转换模型
    //返回数组
    return [NSArray yy_modelArrayWithClass:self json:array];
    
}

@end
